import request from '@/config/axios'

// 试题题库 VO
export interface BankVO {
  id: number // 主键
  name: string // 题库名称
  version: number // 版本号
}

// 试题题库 API
export const BankApi = {
  // 查询试题题库分页
  getBankPage: async (params: any) => {
    return await request.get({ url: `/exam/bank/page`, params })
  },

  // 查询试题题库详情
  getBank: async (id: number) => {
    return await request.get({ url: `/exam/bank/get?id=` + id })
  },

  // 新增试题题库
  createBank: async (data: BankVO) => {
    return await request.post({ url: `/exam/bank/create`, data })
  },

  // 修改试题题库
  updateBank: async (data: BankVO) => {
    return await request.put({ url: `/exam/bank/update`, data })
  },

  // 删除试题题库
  deleteBank: async (id: number) => {
    return await request.delete({ url: `/exam/bank/delete?id=` + id })
  },

  // 导出试题题库 Excel
  exportBank: async (params) => {
    return await request.download({ url: `/exam/bank/export-excel`, params })
  },
}